﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace jDepot.Models
{
    [MetadataType(typeof(ProductValidation))]
    public partial class Product
    {
    }

    public class ProductValidation
    {
        [Required(ErrorMessage="Name is required")]
        [StringLength(100, ErrorMessage = "Name may not be longer than 100 characters")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Description is required")]
        [StringLength(500, ErrorMessage = "Description may not be longer than 100 characters")]
        public string Description { get; set; }

        [Required(ErrorMessage = "Product category is required")]
        public long ProductCategoryId { get; set; }

        [Required(ErrorMessage = "Price is required")]
        public decimal Price { get; set; }
    }
}